home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / 881 / src6.zoo / sign.c < prev    next >
Encoding:
Text File  |  1991-09-24  |  205 b   |  19 lines

  1. double sign (x, y)
  2. double x;
  3. double y;
  4. {
  5.     if (x > 0.0) {
  6.     if (y > 0.0) {
  7.         return(x);
  8.     } else {
  9.         return(-x);
  10.     }
  11.     } else {
  12.     if (y < 0.0) {
  13.         return(x);
  14.     } else {
  15.         return(-x);
  16.     }
  17.     }
  18. }
  19.